1. Field of the Invention
This invention relates to methods and systems for determining, defining, and controlling input and output arguments for computer programs, and especially to methods for adapting input and output argument definition from one format to another such as during migration of existing programs from one computing environment to another.
2. Background of the Invention
When designing a software program, it is often the case that the program design relies on particular program inputs from the end user to be able to run and execute correctly. One method of obtaining these inputs is to “pass in” arguments to the program when invoking the program from the command line. In some cases, for programs which create output, the output can be redirected or “piped” to a destination indicated by a command line argument, as well.
Often, when there are multiple input arguments, the arguments are prefixed with a unique identifying flag that the program then uses to determine what the input argument should be used for. For example, if there exists a program called “MyProgram” that receives as input a user's first and last name, the program might be invoked from the command line as:Java MyProgram-first Ann-last Black
wherein “-first” is the unique flag identifier for the first name, and “Ann” is the argument value to process as the first name, “-last” is the unique flag identifier for the last name, and “Black” is the value to process as the last name. The flag and argument pair will be referred to as a flag/argument value pair from here forward.
Further, it is often the case that when implementing the design of a software program, or when upgrading a software program to provide additional functionality, it may be determined that additional inputs from the end user are necessary. In such a case, the software program's underlying implementation code may need to be altered in multiple places for administering this new input argument. For example, logic must be added for validating the new input argument, the logic that outputs usage information about how to use the program must be altered to encompass the new input argument, logic must be added to route the new input argument to the appropriate software subpiece (e.g. a module, method, plug-in or subroutine) for processing, the code must then be recompiled and built, etc.
Therefore, there are several risks involved when a software program needs even just a single additional input parameter from the user. These risks include: introducing new software bugs when altering existing code, forgetting to update all the necessary places in the software code to handle the new input parameter, and the additional time and expense incurred by a software developer for making the code changes and updates for just being able to have the existing software code handle the new input parameter. This process has to be repeated every time it is determined that a new input argument is necessary and therefore the risk increases with each additional input argument.
Therefore, there is a need in the art for a system a method which allow for the software code that handles the administration of the input and output arguments to be written once, and which allows addition of new input or output arguments without unnecessarily modifying the software program's code, rebuilding or compiling it. This allows the software developer to focus solely on the subpiece of the software that processes the new input or output argument.